<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title>用户管理</title>
    <link th:href="@{/localcss/crmlist.css}" href="../static/localcss/crmlist.css" rel="stylesheet">
    <style>
        #x_nb {
            height: 400px;
        }

        #x_text {
            left: -55px;
        }

        #x_but {
            left: -200px;
        }

        .white_content {
            display: none;
            position: absolute;
            top: 25%;
            left: 15%;
            width: 80%;
            height: 460px;
            padding: 20px;
            border: 0.5px solid #145880;
            background-color: white;
            z-index: 1002;
            overflow: auto;
        }

        .x_nbli {
            width: 30px;
        }

        .chatb {
            margin-left: 1400px;
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div layout:fragment="content">
    <div id="light" class="white_content">
        <div class="x_panel" id="x_nb">
            <div>
                <div class="x_title">
                    <h2>选择病人 <i class="fa fa-user"></i></h2>
                    <div class="chatb">
                        <button onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">
                            ✖
                        </button>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form method="post">
                        <ul class="x_nbul">
                            <li class="x_nbli">
                                <div class="form-group">
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input name="durgname" type="text" placeholder="请输入要查询的信息"
                                               class="form-control col-md-6 col-xs-12" id="x_text" value="">
                                    </div>
                                    <button type="button" class="btn btn-primary" id="x_but" th:onclick="doSelect()">
                                        查询
                                    </button>
                                </div>
                            </li>
                        </ul>
                    </form>
                </div>
            </div>
            <table id="datatable-responsive"
                   class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                   cellspacing="0" width="100%" role="grid"
                   aria-describedby="datatable-responsive_info" style="width: 100%;">
                <thead>
                <tr role="row">
                    <th class="sorting_asc" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="First name: activate to sort column descending"
                        aria-sort="ascending">单据号
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        姓名
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        电话
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        身份证号
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        性别
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        年龄
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        科室
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        医生
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        挂号类别
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        挂号时间
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        挂号费
                    </th>
                    <th class="sorting" tabindex="0"
                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                        aria-label="Last name: activate to sort column ascending">
                        操作
                    </th>
                </tr>
                </thead>
                <tbody id="mobuList">

                </tbody>
            </table>
        </div>
    </div>
    <div class="">
        <div class="clearfix"></div>
        <div class="row">
            <div class="col-md-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>
                            处方划价 <i class="fa fa-user"></i>
                            <small>
                                - 您可以通过搜索或者其他的筛选项对用户的信息进行编辑、删除等管理操作。^_^
                            </small>
                        </h2>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">
                        <form method="post" action="/user/userListPage" th:action="@{/user/userListPage}">
                            <input type="hidden" name="pageIndex" th:value="1"/>
                            <ul>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">姓名</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">身份证号</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">性别</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">年龄</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <button id="start" type="button" class="btn btn-primary"
                                            onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
                                        开始划价
                                    </button>
                                </li>
                            </ul>
                            <ul>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">科室</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">医生</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">电话</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">挂号费</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="usrName" type="text" onfocus="this.blur()"

                                                   class="form-control col-md-6 col-xs-12" value="">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <button type="submit" class="btn btn-primary">填写病因</button>
                                </li>
                            </ul>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script layout:fragment="js">
    function doSelect() {
        var durgname =

        $.ajax({
            type: "post",
            url: "/prescri/mobuList",
            data: "durgname=" + durgname,
            dataType: "json",
            success: function (data) {
                alert(data.records[1].reportId);
                $("#mobuList").html("");
                var atd = " <td>\n" +
                    "                        <div class=\"btn-group\">\n" +
                    "                            <button type=\"button\" class=\"btn btn-danger\">点击操作</button>\n" +
                    "                            <button type=\"button\" class=\"btn btn-danger dropdown-toggle\"\n" +
                    "                                    data-toggle=\"dropdown\" aria-expanded=\"false\">\n" +
                    "                                <span class=\"caret\"></span>\n" +
                    "                                <span class=\"sr-only\">Toggle Dropdown</span>\n" +
                    "                            </button>\n" +
                    "                            <ul class=\"dropdown-menu\" role=\"menu\">\n" +
                    "                                <li><a class=\"editInfo\" href=\"/user/edit?usrId=1\"\n" +
                    "                                       data-toggle=\"tooltip\" data-placement=\"top\" title=\"\"\n" +
                    "                                       data-original-title=\"编辑\">编辑</a></li>\n" +
                    "                                <li><a class=\"delInfo\" id=\"del\" href=\"#\"\n" +
                    "                                       data-toggle=\"tooltip\" data-placement=\"top\" title=\"\"\n" +
                    "                                       data-original-title=\"删除\">删除</a></li>\n" +
                    "                            </ul>\n" +
                    "                        </div>\n" +
                    "                    </td>"
                $(data.records).each(function () {
                    var str = "<tr role=\"row\" class=\"odd\" id=\"mobuList1\">" +
                        "<td>" + this.reportId + "</td><td>" + this.reportName + "</td>" +
                        "<td>" + this.phone + "</td><td>" + this.carid + "</td>" +
                        "<td>" + this.sex + "</td><td>" + this.age + "</td>" +
                        "<td>" + this.department + "</td><td>" + this.doctorName + "</td>" +
                        "<td>" + this.type + "</td><td>" + this.time + "</td>" +
                        "<td>" + this.price + "</td>"+atd+"</tr>";
                    $("#mobuList").append(str);
                })
            }
        });
    }
</script>
</html>